package com.filebackup.struts.actions;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.filebackup.vo.impl.UserVo;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class FilebackupSupport extends ActionSupport {
	
	public HttpSession getSession(){
		return ServletActionContext.getRequest().getSession();
	}
	
	public HttpServletRequest getRequest(){
		return ServletActionContext.getRequest();
	}
	
	public ActionContext getApplication(){
		return ServletActionContext.getContext();
	}
	
	public void setSessionUser(UserVo user){
		this.getSession().setAttribute("sessionUser", user);
	}
	
	public UserVo getSessionUser(){
		return (UserVo) this.getSession().getAttribute("sessionUser");
	}

}
